#include "gtkGlobals.h"

int minuteWork;
int minuteRes;
int countMinute;
int countSecond;
bool isResting;
bool isCounting;
bool killTheProg;
GtkWidget* labelSecond, * labelMinute, * labelNote, * btnStart, * btnReset, * btnMore, * btnLess, * btnSwitch, * topWindow;

void init()
{
    minuteWork = 25;
    minuteRes = 5;
    countMinute = 25;
    countSecond = 0;
    isResting = false;
    isCounting = false;
    killTheProg = false;
    GtkBuilder * builder = gtk_builder_new();
    //if (!gtk_builder_add_from_string(GTK_BUILDER(builder), interface, strlen(interface), nullptr))
    if (!gtk_builder_add_from_file(builder, "tomclk.glade", nullptr))
    {
        printf("tomclk.glade load error\n");
    }
    labelSecond = GTK_WIDGET(gtk_builder_get_object(GTK_BUILDER(builder), "labelSecond"));
    labelMinute = GTK_WIDGET(gtk_builder_get_object(GTK_BUILDER(builder), "labelMinute"));
    labelNote = GTK_WIDGET(gtk_builder_get_object(GTK_BUILDER(builder), "labelNote"));
    topWindow = GTK_WIDGET(gtk_builder_get_object(GTK_BUILDER(builder), "topWindow"));
    btnSwitch = GTK_WIDGET(gtk_builder_get_object(GTK_BUILDER(builder), "btnSwitch"));
    btnStart = GTK_WIDGET(gtk_builder_get_object(GTK_BUILDER(builder), "btnStart"));
    btnReset = GTK_WIDGET(gtk_builder_get_object(GTK_BUILDER(builder), "btnReset"));
    btnMore = GTK_WIDGET(gtk_builder_get_object(GTK_BUILDER(builder), "btnMore"));
    btnLess = GTK_WIDGET(gtk_builder_get_object(GTK_BUILDER(builder), "btnLess"));
}